#ifndef __MATH_CURVE_FITTING_H__
#define __MATH_CURVE_FITTING_H__

typedef struct
{
    float x;
    float y;
    float radius;
}  circle_t;

typedef struct
{
    float* p_x;
    float* p_y;
    int lens;

    float n;
    float sum_X1;
    float sum_X1Y1;
    float sum_X2;
    float sum_X2Y1;
    float sum_X3;
    float sum_Y1;
    float sum_Y2;
    float sum_Y2X1;
    float sum_X2_Y2;
    float sum_Y3;
}  circle_fitter_t;

void circle_fitting_init(circle_fitter_t* circle_fitter, float* x_array, float* y_array, int lens);
void circle_fitting_with_points(circle_fitter_t* circle_fitter, circle_t* circle);

#endif
